﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="return_view_mail.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Letter.return_view_mail" %>

<%@ Import Namespace="DataAccess" %>
<%@ Import Namespace="System.Linq" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <% 
            var Species = Request.Form["Species"];
            var Email_ID = Request.Form["Email_ID"];
            if (Species == "1")
            {
                var emailColl = new TblContactController().FetchAll();
                var email = emailColl.Single(x => x.Id == Convert.ToInt32(Email_ID));
                new TblContactController().Update(email.Id, email.FullName, email.Birthday, email.Sex, email.Email, email.Phone, email.Address, email.Job, email.Traditional, email.Purpose, email.Degree, email.ClassX, email.Request, false, email.DateX, email.Sended);

            }
            if (Species == "2")
            {
                var emailColl = new TblFeedbackController().FetchAll();
                var email = emailColl.Single(x => x.Id == Convert.ToInt32(Email_ID));
                new TblFeedbackController().Update(email.Id, email.FullName, email.Email, email.Phone, email.Problem, email.RpContent, false, email.Sended);
            }
        
    %>

</body>
</html>
